package com.ruoyi.ldzlsb.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.ldzlsb.mapper.SbInspectionDetailMapper;
import com.ruoyi.ldzlsb.domain.SbInspectionDetail;
import com.ruoyi.ldzlsb.service.ISbInspectionDetailService;

/**
 * 巡检明细Service业务层处理
 * 
 * @author anli
 * @date 2025-01-11
 */
@Service
public class SbInspectionDetailServiceImpl implements ISbInspectionDetailService
{
    @Autowired
    private SbInspectionDetailMapper sbInspectionDetailMapper;

    /**
     * 查询巡检明细
     * 
     * @param detailId 巡检明细主键
     * @return 巡检明细
     */
    @Override
    public SbInspectionDetail selectSbInspectionDetailByDetailId(Long detailId)
    {
        return sbInspectionDetailMapper.selectSbInspectionDetailByDetailId(detailId);
    }

    /**
     * 查询巡检明细列表
     * 
     * @param sbInspectionDetail 巡检明细
     * @return 巡检明细
     */
    @Override
    public List<SbInspectionDetail> selectSbInspectionDetailList(SbInspectionDetail sbInspectionDetail)
    {
        return sbInspectionDetailMapper.selectSbInspectionDetailList(sbInspectionDetail);
    }

    /**
     * 新增巡检明细
     * 
     * @param sbInspectionDetail 巡检明细
     * @return 结果
     */
    @Override
    public int insertSbInspectionDetail(SbInspectionDetail sbInspectionDetail)
    {
        sbInspectionDetail.setCreateTime(DateUtils.getNowDate());
        return sbInspectionDetailMapper.insertSbInspectionDetail(sbInspectionDetail);
    }

    /**
     * 修改巡检明细
     * 
     * @param sbInspectionDetail 巡检明细
     * @return 结果
     */
    @Override
    public int updateSbInspectionDetail(SbInspectionDetail sbInspectionDetail)
    {
        sbInspectionDetail.setUpdateTime(DateUtils.getNowDate());
        return sbInspectionDetailMapper.updateSbInspectionDetail(sbInspectionDetail);
    }

    /**
     * 批量删除巡检明细
     * 
     * @param detailIds 需要删除的巡检明细主键
     * @return 结果
     */
    @Override
    public int deleteSbInspectionDetailByDetailIds(Long[] detailIds)
    {
        return sbInspectionDetailMapper.deleteSbInspectionDetailByDetailIds(detailIds);
    }

    /**
     * 删除巡检明细信息
     * 
     * @param detailId 巡检明细主键
     * @return 结果
     */
    @Override
    public int deleteSbInspectionDetailByDetailId(Long detailId)
    {
        return sbInspectionDetailMapper.deleteSbInspectionDetailByDetailId(detailId);
    }

    /**
     * 根据巡检单ID查询巡检明细列表
     * 
     * @param recordId 巡检单ID
     * @return 巡检明细集合
     */
    @Override
    public List<SbInspectionDetail> selectSbInspectionDetailByRecordId(Long recordId)
    {
        return sbInspectionDetailMapper.selectSbInspectionDetailByRecordId(recordId);
    }

    /**
     * 批量新增巡检明细
     * 
     * @param detailList 巡检明细列表
     * @return 结果
     */
    @Override
    public int batchInsertSbInspectionDetail(List<SbInspectionDetail> detailList)
    {
        return sbInspectionDetailMapper.batchInsertSbInspectionDetail(detailList);
    }

    /**
     * 批量修改巡检明细
     * 
     * @param detailList 巡检明细列表
     * @return 结果
     */
    @Override
    public int batchUpdateSbInspectionDetail(List<SbInspectionDetail> detailList)
    {
        return sbInspectionDetailMapper.batchUpdateSbInspectionDetail(detailList);
    }
} 